var e = require("../../../utils/function.js"), a = getApp(), t = require("../../../api.js");

Page({
    data: {
        img: e.userImg,
        order: []
    },
    onLoad: function(e) {
        e.uid && a.shareCouponsMessage(e.uid);
    },
    intoPageHandler: function(a) {
        console.log(a.currentTarget.dataset.skip), wx.setStorageSync("current_order", wx.getStorageSync("order")[a.currentTarget.dataset.id]), 
        e.intoPageHandler(a.currentTarget.dataset.skip);
    },
    onReady: function() {},
    onShow: function() {
        var e = this;
        a.request({
            url: t.accident.index,
            method: "post",
            data: {},
            success: function(a) {
                e.setData({
                    order: a.data.data
                });
            }
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        var e = this;
        wx.showNavigationBarLoading();
        var n = 1;
        n += 1, a.request({
            url: t.accident.index,
            method: "post",
            data: {
                page: n
            },
            success: function(a) {
                e.setData({
                    order: a.data.data
                }), wx.hideNavigationBarLoading();
            }
        });
    },
    onShareAppMessage: function() {
        var e = a.shareAppMessage().title, t = a.shareAppMessage().imageUrl, n = a.shareAppMessage().desc, r = a.shareAppMessage().path;
        return console.log(a.shareAppMessage()), {
            title: e,
            imageUrl: t,
            desc: n,
            path: r
        };
    }
});